//
//  BangZhuShouCeViewController.m
//  XiangMu
//
//  Created by 康世标 on 15/8/12.
//  Copyright (c) 2015年 康世标. All rights reserved.
//

#import "BangZhuShouCeViewController.h"

@interface BangZhuShouCeViewController ()

@end

@implementation BangZhuShouCeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.tabBarController.tabBar.hidden=YES;
    UIButton *fanHuiBtn=[UIButton buttonWithType:UIButtonTypeCustom];
    fanHuiBtn.frame=CGRectMake(20, 20, 10, 20);
    
    [fanHuiBtn setBackgroundImage:[UIImage imageNamed:@"fanhui"] forState:UIControlStateNormal];
    
    [fanHuiBtn addTarget:self action:@selector(FanHui) forControlEvents:UIControlEventTouchUpInside];
    
    UIBarButtonItem *barFanHui = [[UIBarButtonItem alloc]initWithCustomView:fanHuiBtn];
    self.navigationItem.leftBarButtonItem = barFanHui;
    self.title = @"帮助手册";
    _textArr = [[NSMutableArray alloc]initWithObjects:@"优惠问题",@"支付问题",@"订单问题",@"其他问题", nil];

    self.urlArr = [NSArray arrayWithObjects:URL_YOUHUIWENTI,URL_ZHIFUWENTI,URL_DINGDANWENTI,URL_QITAWENTI ,nil];
    
}
#pragma mark--UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  
    return _textArr.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString*str=@"";
    UITableViewCell*cell=[tableView dequeueReusableCellWithIdentifier:str];
    if (!cell) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:str];
    }
    
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    cell.textLabel.text = [_textArr objectAtIndex:indexPath.row];
    
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    
    return cell;
    
}
#pragma mark --- UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    GuanYuWoMenViewController * guan = [[GuanYuWoMenViewController alloc]init];
    
    guan.url = [self.urlArr objectAtIndex:indexPath.row];
    
    guan.title = [self.textArr objectAtIndex:indexPath.row];
    
    guan.bangZhu = YES;
    
    [self.navigationController pushViewController:guan animated:YES];
    
    
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)FanHui{
     self.tabBarController.tabBar.hidden=NO;
    [self.navigationController popViewControllerAnimated:YES];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
